#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext >
#include "factory.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QGuiApplication app(argc, argv);

    Factory* fac = new ConcreteFactory();

    QQuickView view;
    view.engine()->rootContext()->setContextProperty("Factory", fac);
    view.setSource(QUrl(QStringLiteral("qrc:/main.qml")));
    view.setTitle("Factory模式演示demo");
    view.show();

    return app.exec();
}
